infra: add sync:ii-spec script, port II spec commits, and sync vc-spec#249
Merged
Conversation
Adds scripts/sync-ii-spec.mjs — a deterministic 1:1 sync script that transforms docs/ii-spec.mdx from dfinity/internet-identity into docs/references/internet-identity-spec.md. Applies the same pattern as sync-motoko: strip MDX imports, remove H1, inline the Candid .did file, rewrite 8 absolute link patterns to relative paths, inject frontmatter. Bumps .sources/internetidentity to af980848..74ad617 (16 commits) and regenerates internet-identity-spec.md from the new pin. Updates AGENTS.md: internetidentity row now says to run npm run sync:ii-spec instead of manually applying patches; link-adaptation note updated to match.
…cope Three corrections to the sync script: - Add m flag to H1 regex so it matches after leading blank lines from import stripping - Move Candid inlining after link rewriting so .did code comments are not rewritten - Exclude code blocks from the remaining-links check (prose only) - Restore sidebar order: 14 to match previous value
FETCH_HEAD is a file that could theoretically be overwritten between steps if another fetch runs. Using the hash saved to step outputs is safer and more explicit.
checkEmdash already tracks inFence state to skip code blocks. checkForbiddenPatterns was missing the same logic, causing false positives on URLs inside Candid/code block comments.
…nline Consistent with ic.did / http-gateway.did: copy internet_identity.did to public/references/internet-identity.did and replace the <CodeBlock> inline with a prose download link. Reduces internet-identity-spec.md from 2075 to 736 lines. Workflow updated to stage the .did file.
Site uses remarkPlantUML; Mermaid blocks render as raw text. The sync script now converts sequenceDiagram blocks to PlantUML automatically. Conversion rules: participant alias/name flipped and quoted, <br> becomes \n, sequenceDiagram keyword stripped, wrapped in @startuml/@enduml. Adds a validation check that exits non-zero if any mermaid blocks remain after conversion (catches unsupported diagram types added upstream).
…rand skin The plugin only injects the SKIN when content does not already start with @startuml. Other diagrams in the docs omit the wrapper and let the plugin add it. Converted diagrams now follow the same pattern.
…dentials-spec.md Extends the sync script to also produce a normative reference page from .sources/internetidentity/docs/vc-spec.md. Rewrites 5 stale portal links at sync time; upstream fix tracked in dfinity/internet-identity#3889. The ii-spec link to vc-spec.md now resolves to the reference page instead of the implementation guide. The guide's "Next steps" section updated to link to the new reference page rather than the raw GitHub file.
- Submodule table: add docs/vc-spec.md as a synced source - Extra checks row: document vcLinkMap, clarify the "only bump if synced docs changed" policy, and note the workflow skips unrelated code bumps - Link adaptation section: cover verifiable-credentials-spec.md and note that the vc-spec rewrites become harmless once dfinity/internet-identity#3889 is resolved - Workflow: add docs/vc-spec.md to the changed-files filter, stage verifiable-credentials-spec.md in the commit step, and update PR body
Switches the internetidentity submodule from main-tracking to release-tracking. Spec changes are only live once the canister is deployed at a release, so pinning to main could expose unreleased changes in docs. - Pins submodule to release-2026-05-08 (f6cf858), reverting an unreleased internet_identity.did change - Updates VERSIONS to record the current release - Workflow now finds the latest release-YYYY-MM-DD tag (not main), uses tag name in branch/commit/PR title, and auto-updates VERSIONS - AGENTS.md: updates pinning strategy description and extra checks row
raymondk
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/sync-ii-spec.mjs— a deterministic sync script that transforms upstream specs fromdfinity/internet-identityinto reference pages; same pattern assync-motoko.shdocs/ii-spec.mdx→docs/references/internet-identity-spec.md: strip MDX imports, remove H1, rewrite 8 absoluteinternetcomputer.orglink patterns to relative paths, inline the Candid.didfile in place of<CodeBlock>, inject frontmatter, append link-adaptation logdocs/vc-spec.md→docs/references/verifiable-credentials-spec.md: remove H1, rewrite 5 stale portal links to relative internal paths, inject frontmatter, append link-adaptation log; upstream fix tracked indfinity/internet-identity#3889.sources/internetidentitytorelease-2026-05-08(f6cf858) — switches from main-tracking to release-tracking; spec changes are only live once the canister is deployedinternetidentityto.sources/VERSIONSalongside other release-pinned submodules"sync:ii-spec": "./scripts/sync-ii-spec.mjs"topackage.json.github/workflows/sync-ii-spec.yml— runs weekly on Tuesday and onworkflow_dispatch; finds the latestrelease-YYYY-MM-DDtag, filters for changes toii-spec.mdx,vc-spec.md, orinternet_identity.did, and opens a PR (with VERSIONS update) only if relevant files changedverifiable-credentials-specto the sidebar and reference indexAGENTS.md: documents both output files,vcLinkMap, release-based pinning strategy, and the "only bump if synced docs changed" policyscripts/validate.js:checkForbiddenPatternsnow skips code blocks (same ascheckEmdash), preventing false positives on URLs inside Candid code commentsSync recommendation
sync from dfinity/internet-identity — docs/ii-spec.mdx, docs/vc-spec.md, src/internet_identity/internet_identity.did